////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

#ifndef __WN_SCRIPTING_PARSE_TREE_H__
#define __WN_SCRIPTING_PARSE_TREE_H__

#include "WNScripting/inc/WNParseNode.h"

#include <deque>

namespace WNScripting {

    class WNTopLevelElementList;
    class WNTopLevelElement;
    struct WNFunction;

    class WNParseTree : public WNParseNode {
    public:
        virtual ~WNParseTree();
        WNParseTree(WN_SIZE_T _startLine,
                    WN_SIZE_T _endLine,
                    WN_SIZE_T _startChar,
                    WN_SIZE_T _endChar,
                    WNTopLevelElement* _topLevelElementList);

        WN_VOID CompileCode(WNScriptingEngineData& _scriptingData,  WNFunction** _function);
        virtual WN_BOOL ReportErrors();

    private:
        WNTopLevelElement* mTopLevelElement;
        std::deque<WNTopLevelElement*> mTopLevelElements;
    };
}
#endif // __WN_SCRIPTING_PARSE_TREE_H__